﻿

@{
    ViewBag.Title = "Index";
}

@{
  
  string x = (string)ViewBag.Categories;
  
  
  
  
}
<script type="text/javascript">

  $(document).ready(function () {

    var urlGet = 'http://anche-pc:90/Qna/Qna.svc/web/TestMe';
    var d = 'message=Thisismyworld&num=23423';

//    $.getJSON(
//          urlGet,
//          {},
//          function (data) { alert('test'); }
//        );

            $.ajax({
              url: "http://anche-pc:90/Qna/Qna.svc/web/TestMe",
              data: "{}",
              //contentType: "application/json; charset=utf-8",
              dataType: "text",
              success: function (msg) {
                alert('hi');
              }
            });
   });

　

   function djlHelloWorldInitiate() {
//      $.ajax({
//          type: "POST", //GET or POST or PUT or DELETE verb
//          url: globalDjlScormWebServiceUrl + "TestMe", //*****works with factory on the svc file
//          //important to ensure the single and double quotes are correct
//          data: "?message=HelloWorldHelloGlobe&num=3243423" ,// '{"message":"This is my message","num":234234}', //newCourseStart, //'{"reqStudent": "' + locJavaStudents + '"}', //jsonText, //
//          contentType: "application/json; charset=utf-8", // content type sent to server
//          dataType: "json", ///"json", //Expected data format from server
//          //processdata : varProcessData, //True or False
//          success: djlHelloWorldSuccess,
//          error: djlHelloWorldFailure
//      });  
//url: url,
//  dataType: 'json',
//  data: data,
//  success: callback


//        $.ajax({
//          //type: "POST",
//          url: "http://anche-pc:90/Qna/Qna.svc/web/TestMe",
//          data: "{}",
//          //contentType: "application/json; charset=utf-8",
//          dataType: "html",
//          success: function (msg) {
//            alert('hi');
//          }
//        });

//         url: urlGet,
//          data: { },
//          dataType: "text",
//          async: false,
//          success: function (data, text, e) {
//            alert('success');
//          },
//          error: function (request, status, errorThrown) {
//            alert('error');
//          }
//        $.getJSON(
//            urlGet,
//            { message: "This is my world", num: "23423" },
//            function (json) {
//              var result = "Language code is \"<strong>" + json.responseData.language + "\"";
//              alert(result);
//            }
//        );  


    }

 

 

    function djlHelloWorldSuccess(data) {

        alert(data.d);

    }

 

    function djlHelloWorldFailure(request, status, error) {

        alert("helloWorld FAILED error is -150PM(POST):" + request.statusText );

    }

</script>

<h2>Index</h2>

@Html.Raw(HttpUtility.HtmlDecode(x))
@Html.Raw(HttpUtility.HtmlDecode((string)ViewBag.CategoryModPanel))